package c.f.c.a.j;

import c.f.c.a.c;
import c.f.c.a.f;
import java.util.concurrent.Executor;

public final class b<TResult> implements c.f.c.a.b<TResult> {
    public c<TResult> a;
    public Executor b;
    public final Object c = new Object();

    public class a implements Runnable {
        public final /* synthetic */ f a;

        public a(f fVar) {
            this.a = fVar;
        }

        public final void run() {
            synchronized (b.this.c) {
                c cVar = b.this.a;
                if (cVar != null) {
                    cVar.onComplete(this.a);
                }
            }
        }
    }

    public b(Executor executor, c<TResult> cVar) {
        this.a = cVar;
        this.b = executor;
    }

    public final void cancel() {
        synchronized (this.c) {
            this.a = null;
        }
    }

    public final void onComplete(f<TResult> fVar) {
        this.b.execute(new a(fVar));
    }
}
